import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate';

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [createPersistedState()],
  state: {
    userInfo: null,
    // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0aW1lIjoxNzE2NzgzOTA1LCJ1c2VyX2lkIjoiNTc3Iiwibmlja19uYW1lIjoiaUdpcmwiLCJleHAiOjE3MjU0MjM5MDV9.Mi8iiSz5rewMVJD1v69o_vr2CuRiulZn5EfoRwUAMhM',
    token: null,
    shop: null,
    searchList: [],
  },
  mutations: {
    setUserInfo (state, userInfo) {
      state.userInfo = userInfo
    },
    setToken (state, token) {
      state.token = token
    },
    setShop (state, shop) {
      state.shop = shop
    },
    setSearchList (state, searchList) {
      state.searchList = searchList
    },
  },
  actions: {
  },
  modules: {
  }
})
